use v6;
use NativeCall;

my sub logger_printf(int32, Str is encoded('utf8')) is native('cua') {*}
my sub c_panic(Str is encoded('utf8')) is native('cua') {*}
my sub c_hash64(CArray[uint8], uint64 , uint64 --> int64) is native('cua') {*}

my sub c_hash(Str $str, Int seed=0 --> UInt) {
	my $buf = CArray[uint8].new($str.encode.list);
	my $r = c_hash64($buf, $buf.elems, seed);
	$r < 0 ?? 2**64 + $r !! $r	
}

